package com.pwt.service;

import com.pwt.common.ResultPage;
import com.pwt.entity.ProductFeature;
import com.pwt.repository.ProductFeatureRepository;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

/**
 * ProductFeature service层
 *
 * @author auto generated
 * @date 2021-08-31 12:03:28
 */
@Service
public class ProductFeatureService {

    private ProductFeatureRepository productFeatureRepository;

    public ProductFeatureService(ProductFeatureRepository productFeatureRepository){
        this.productFeatureRepository = productFeatureRepository;
    }

    public ResultPage getFeatures(String name,Integer page, Integer limit){

        return this.productFeatureRepository.queryProductFeaturePage(name,page,limit);
    }


//    public ProductFeature add(ProductFeature productFeature){
//        return this.productFeatureRepository.save(productFeature);
//    }
//
//    public ProductFeature getById(String id){
//        return this.productFeatureRepository.getById(id);
//    }
//
//    public void delete(String id){
//         this.productFeatureRepository.deleteById(id);
//    }
}
